package com.zhm.demo.json;

import cn.hutool.core.io.FileUtil;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.module.jsonSchema.JsonSchema;
import com.fasterxml.jackson.module.jsonSchema.JsonSchemaGenerator;
import com.zhm.base.TestReq;

import java.net.URL;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Map;

public class Json {

    public static void main(String[] args) throws Exception {

        URL resource = JsonValidationTest.class.getResource("/a.json");
        String json = FileUtil.readString(resource, Charset.forName("UTF-8"));
        ObjectMapper mapper = new ObjectMapper();

        Map map = mapper.readValue(json.getBytes(StandardCharsets.UTF_8), Map.class);

        System.out.println(map);

    }
}
